File code/Scrawl.php

class Tlf\Scrawl

Constants

Properties

  • public array $stuff = []; array for get/set
  • public array $extensions = [ 'code'=>[], ];
  • public string $dir_docs = null; absolute path to your documentation dir
  • public string $dir_root = null; absolute path to the root of your project
  • public string $dir_src = null; absolute path to the documentation source dir
  • public array $dir_scan = []; array of relative path to dirs to scan, within your dir_root
  • public array $verb_handlers = []; array of handlers for the mdverb extension
  • public array $template_dirs = []; absolute path to directories that contain md templates
  • public bool $markdown_preserveNewLines = true; if true, append two spaces to every line so all new lines are parsed as new lines
  • public bool $markdown_prependGenNotice = true; if true, add an html comment to md docs saying not to edit directly
  • public bool $readme_copyFromDocs = true; if true, copies docs/README.md to project root README.md
  • public bool $deleteExistingDocs = false; If true will delete all files in your docs dir before running

Methods

  • public function __construct(array $options=[])

  • public function get_template(string $name, array $args)

  • public function get(string $group, string $key)

  • public function get_group(string $group)

  • public function set(string $group, string $key, $value)

  • public function parse_str($str, $ext)

  • public function write_doc(string $rel_path, string $content) save a file to disk in the documents directory

  • public function write_file(string $rel_path, string $content) save a file to disk in the root directory

  • public function read_file(string $rel_path) Read a file from disk, from the project root

  • public function read_doc(string $rel_path) Read a file from disk, from the project docs dir

  • public function doc_path(string $rel_path) get a path to a docs file

  • public function report(string $msg) Output a message to cli (may do logging later, idk)

  • public function warn($header, $message) Output a message to cli, header highlighted in red

  • public function good($header, $message) Output a message to cli, header highlighted in red

  • public function prepare_md_content(string $markdown) apply small fixes to markdown

  • public function get_all_docsrc_files()

  • public function get_all_scan_files(): array get array of all files in $scrawl->dir_scan

  • public function generate_apis() Generate api docs for all files
    (currently only php files)

  • public function generate_api($rel_path) Generate api doc for a signle file
    (currently only php files)

  • public function get_all_classes()

  • public function run() Execute scrawl in its entirety

  • public function get_ast(string $file): array get an array ast from a file
    Currently only supports php files
    Also sets the ast to scrawl

  • public function get_mdverb_ext() get the class ast